﻿<UserControl x:Class="usrPastis"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             xmlns:DVCP="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>

        <DVC:Chart Name="Chart1" >
            <!-- Style -->
            <DVC:Chart.Style>
                <Style TargetType="DVC:Chart">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="DVC:Chart">
                                <Grid>
                                    <DVCP:EdgePanel x:Name="ChartArea" Style="{TemplateBinding ChartAreaStyle}" />
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </DVC:Chart.Style>

            <!-- Palette -->
            <DVC:Chart.Palette>
                <DV:ResourceDictionaryCollection>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="#FF39A330"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="#FFD33B3B"/>
                        </Style>
                    </ResourceDictionary>
                    <ResourceDictionary>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="#FF4787CF"/>
                        </Style>
                    </ResourceDictionary>
                    <!--Add more datapoint styles as needed -->
                </DV:ResourceDictionaryCollection>
            </DVC:Chart.Palette>


            <!-- Series -->
            <DVC:Chart.Series>
                <DVC:PieSeries IndependentValueBinding="{Binding Path=Key}" 
                                      DependentValueBinding="{Binding Path=Value}" />
            </DVC:Chart.Series>

        </DVC:Chart>

    </Grid>
</UserControl>
